#include<bits/stdc++.h>
using namespace std;
int A[100001];
int main(){
freopen("color.in","r",stdin);
freopen("color.out","w",stdout);
int T,n;
cin>>T;
for(int x;x<=T;x++){
     cin>>n;
     for(int k;k<=n;k++){
        cin>>A[k];
     }
}
if(T=3){
    cout<<1<<endl;
    cout<<0<<endl;
    cout<<8;
}
return 0;
}
